<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button>点击</button>
<script>
  document.querySelector('button').onclick = function (){
    const fnName = 'shen' + Math.random().toString(36).slice(2) + Date.now();
    window[fnName] = function (num){
      console.log(num);
    }
    const script = document.createElement('script');
    script.src = "http://shenxiaoxu.com/info?callback=" + fnName;
    script.onload = function (){
      document.body.removeChild(script);
      delete window[fnName];
    }

    document.body.appendChild(script);
  }
</script>
</body>
</html>